function switchForm(event) {
    event = event || window.event; // 添加这一行
    event.preventDefault(); // 取消默认的表单提交行为

    var loginForm = document.getElementById("loginForm");
    var registerForm = document.getElementById("registerForm");
    var switchText = document.getElementById("switchText");

    if (loginForm.style.display === "none") {
      // 切换到登录表单
      loginForm.style.display = "";
      registerForm.style.display = "none";
      switchText.innerHTML = "Don't have an account? <a href='#' onclick='switchForm(event)'>Register now</a>";
    } else {
      // 切换到注册表单
      loginForm.style.display = "none";
      registerForm.style.display = "";
      switchText.innerHTML = "Already have an account? <a href='#' onclick='switchForm(event)'>Login</a>";
    }
  }
  function toggleList() {
    var listContainer = document.getElementById("list-container");
    if (listContainer.style.display === "none") {
        listContainer.style.display = "block";
    } else {
        listContainer.style.display = "none";
    }
}